package com.youmu.xxessj.ut

import android.content.Context

class Utils {
    init {
        throw UnsupportedOperationException("u can't instantiate me...")
    }
//    fun getToke(id : String ,pw:String){
//        val userInfoProvider = RongIM.UserInfoProvider(UserInfo(id, pw, Uri.parse("")))
//    }



    companion object {
        @JvmField
        var context: Context? = null

        /**
         * 初始化工具类
         * @param context 上下文
         */
        fun init(context: Context) {
            Utils.context = context.applicationContext
        }

        /**
         * 获取ApplicationContext
         * @return ApplicationContext
         */
        @JvmStatic
        fun getContext(): Context {
            if (context != null) return context!!
            throw NullPointerException("u should init first")
        }
    }
}